<?php

/**
 * VTNSOrder form base class.
 *
 * @method VTNSOrder getObject() Returns the current form's model object
 *
 * @package    vtns
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVTNSOrderForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'order_id'        => new sfWidgetFormInputHidden(),
      'type_visa'       => new sfWidgetFormInputText(),
      'purpose_visa'    => new sfWidgetFormInputText(),
      'processing_time' => new sfWidgetFormInputText(),
      'date_arrival'    => new sfWidgetFormDateTime(),
      'port_arrival'    => new sfWidgetFormInputText(),
      'full_name'       => new sfWidgetFormInputText(),
      'email'           => new sfWidgetFormInputText(),
      'country'         => new sfWidgetFormInputText(),
      'status'          => new sfWidgetFormInputText(),
      'notes'           => new sfWidgetFormTextarea(),
      'total_price'     => new sfWidgetFormInputText(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'order_id'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('order_id')), 'empty_value' => $this->getObject()->get('order_id'), 'required' => false)),
      'type_visa'       => new sfValidatorInteger(array('required' => false)),
      'purpose_visa'    => new sfValidatorInteger(array('required' => false)),
      'processing_time' => new sfValidatorInteger(array('required' => false)),
      'date_arrival'    => new sfValidatorDateTime(array('required' => false)),
      'port_arrival'    => new sfValidatorInteger(array('required' => false)),
      'full_name'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'email'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'country'         => new sfValidatorInteger(array('required' => false)),
      'status'          => new sfValidatorInteger(array('required' => false)),
      'notes'           => new sfValidatorString(array('required' => false)),
      'total_price'     => new sfValidatorPass(array('required' => false)),
      'created_at'      => new sfValidatorDateTime(),
      'updated_at'      => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('vtns_order[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'VTNSOrder';
  }

}
